package com.bmft;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProcessBarActivity13 extends AppCompatActivity {
    private ProgressBar progressBar;
    private ProgressBar progressBar2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_process_bar13);
        progressBar = findViewById(R.id.progress_bar);
        progressBar2 = findViewById(R.id.progress_bar2);
    }

    public void backToMain(View view) {
        Intent intent = new Intent(ProcessBarActivity13.this, MainActivity.class);
        startActivity(intent);
    }

    /**
     * 直接判断改变progressBar的可见性即可.
     * @param v
     */
    public void ChangeVisibility(View v) {
        if (progressBar.getVisibility() == View.GONE) {
            progressBar.setVisibility(View.VISIBLE);
        } else {
            progressBar.setVisibility(View.GONE);
        }

    }

    public void changeProgress(View view) {
        int progress = progressBar2.getProgress();
        if (progress == 100){
            progress = 0;
        }else {
            progress += 10;
        }
        progressBar2.setProgress(progress);
    }


}
